<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>第8天JavaScript程序（谁能进图书馆）</title>
    <script type="text/javascript">
        var a = prompt("请输入禁入年龄线：","");
        var b = prompt("请输入陪同年龄线：","");
        var c = prompt("请输入第一位的年龄：","");
        var d = prompt("请输入第二位的年龄：","");
        if(c >= a&&d >= a) {
            alert(c + "-Y " + d + "-Y " + "huan ying ru guan");
        } else if(c < a && d < a) {
            alert(c + "-N " + d + "-N " + "zhang da zai lai ba");
        } else if((c < a && d >= b)||(d < a && c >= b)) {
            alert(c + "-Y " + d + "-Y ");
            if (c > d)
                alert("qing 1 zhao gu hao 2");
            else
                alert("qing 2 zhao gu hao 1");
        } else if((c < a && d >= a && d < b)||(d < a && c >= a && c < b)) {
            if(c > d)
                alert(c + "-Y " + d + "-N " + "1: huan ying ru guan");
            else
                alert(c + "-N " + d + "-Y " + "2: huan ying ru guan");
        }
        alert("第八个Javascrpit程序。");
        d = new Date();
        document.write(d.toString());
    </script>
</head>
<body></body>
</html>
